﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace eLoan.Models
{
    public class SalesReportModel
    {
        [Display(Name = "Select a branch")]
        public IEnumerable<SelectListItem> Branches { get; set; }

        public string SelectedBranchCode { get; set; }

        [Display(Name = "From")]
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:MM/dd/yyyy}")]
        public DateTime FromDate { get; set; }

        [Display(Name = "To")]
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:MM/dd/yyyy}")]
        public DateTime ToDate { get; set; }

        public List<SalesReportItem> SalesReportItems { get; set; }

        [Display(Name = "Total Loan Amount")]
        public decimal TotalLoanAmount { get; set; }

        [Display(Name = "Total Deduction")]
        public decimal TotalLoanDeduction { get; set; }

    }

    public class SalesReportItem
    {
        [Display(Name = "Document No")]
        public string DocumentNo { get; set; }

        [Display(Name = "Date Released")]
        public DateTime? DateReleased { get; set; }

        [Display(Name = "Borrower")]
        public string BorrowerName { get; set; }

        [Display(Name = "Agent")]
        public string AgentName { get; set; }

        [Display(Name = "Loan Type")]
        public string LoanTypeName { get; set; }

        [Display(Name = "Loan Amount")]
        public decimal LoanAmount { get; set; }

        [Display(Name = "Total Deduction")]
        public decimal TotalDeduction { get; set; }

        [Display(Name = "Loan Interest")]
        public decimal LoanInterest { get; set; }

        [Display(Name = "Loan Interest Amount")]
        public decimal LoanInterestAmount { get; set; }

        [Display(Name = "Payment Start Date")]
        public DateTime? PaymentStartDate { get; set; }

        [Display(Name = "Payment End Date")]
        public DateTime? PaymentEndDate { get; set; }

        [Display(Name = "Loan Status")]
        public string LoanStatus { get; set; }


    }

}